import 'package:flutter/material.dart';
///课堂专用
class RoundCheckBoxCourse extends StatefulWidget {
  bool value = false;
  bool isRadio = false;

  Function(bool) onChanged;

  RoundCheckBoxCourse({Key key, @required this.value, this.onChanged, this.isRadio=false})
      : super(key: key);

  @override
  _RoundCheckBoxCourseState createState() => _RoundCheckBoxCourseState();
}

class _RoundCheckBoxCourseState extends State<RoundCheckBoxCourse> {
  @override
  Widget build(BuildContext context) {
    return GestureDetector(
          onTap: () {
            if (widget.isRadio)
              {
                if (widget.value) return;
              }
            widget.value = !widget.value;
            widget.onChanged(widget.value);
          },
          child: Padding(
            padding: const EdgeInsets.only(bottom: 5,top: 10),
            child: widget.value
                ? Icon(
              Icons.check_circle,
              size: 25.0,
              color: Colors.red,
            )
                : Icon(
              Icons.panorama_fish_eye,
              size: 25.0,
              color: Colors.grey,
            ),
          ),
    );
  }
}

